package com.jt.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SysResult {
 private Integer status;
 private  String msg;
 private Object data;

 public static SysResult fail (){
  return new SysResult(201,"服务器处理失败",null);
 }
 public static SysResult success(){
  return new SysResult(200,"服务器处理成功",null);
 }
 public static SysResult success(Object data){
  return new SysResult(200,"服务器处理成功",data);
 }//容易和下面这个方法产生二义性，因为服务器返回的数据很可能是json字符串，
// public static SysResult success(String msg){
//  return new SysResult(200,msg,null);
// }//错误，参数之间耦合，有二义性，
 public static SysResult success(String msg, Object data){
  return new SysResult(200,msg,data);
 }
}
